package com.ia.aistream.common.utils;

import java.text.SimpleDateFormat;

public class TimeUtils {

	static final long ONE_SECOND = 1000L;
	/***
	 * 获取unix时间戳
	 * @param timeInMillis
	 * @return
	 */
	public static long getUnixTime(long timeInMillis) {
		return (timeInMillis / ONE_SECOND);
	}
	
	public static String parseUnixTime(long timeInMillis,String pattern) {
		SimpleDateFormat format = new SimpleDateFormat(pattern);

		Long time=new Long(timeInMillis);

		String d = format.format(time);
		return d;
	}
}
